package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.category;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 管理后台 - ERP 财务类别（付款/收款）VO
 *
 * @author 芋道源码
 */
@Data
@Schema(description = "管理后台 - ERP 财务类别 VO")
public class PRCategoryVO {

    @Schema(description = "类别编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotBlank(message = "类别编号")
    private long id;

    @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "办公采购")
    @NotBlank(message = "类别名称不能为空")
    private String name;

    @Schema(description = "关联的现金流名称", example = "某现金流")
    private String cashFlow;

    @Schema(description = "父类别", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    private long parent;

    @Schema(description = "子类别列表")
    private List<ChildCategory> children;

    /**
     * 子类别VO
     */
    @Data
    public static class ChildCategory {
        @Schema(description = "子类别编号", example = "2")
        private long id;

        @Schema(description = "子类别名称", example = "办公用品")
        private String name;

        @Schema(description = "子类别关联的现金流名称", example = "办公现金流")
        private String cashFlow;
    }
}